/**
 * Created by yanghaijin on 2018/1/31.
 */


var DB_URL = "mongodb://localhost:27017";
var DB_NAME = "chess";
var table = "users";
// "users"
// "mahjong_rooms"
// "poker_rooms"

let MongoDBUtil = require("../utils/MongoDBUtil");
let Socket = require("socket.io");
let User = require("../data/User.class");
let ServerSocket = function (server) {
    let serverSocket = Socket(server);
    // MongoDBUtil.connectMongoDB(DB_URL, DB_NAME);
    serverSocket.on("connection", function (socket) {
        console.log("a user connection");
        new User(socket);
    });
};
module.exports = ServerSocket;